<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset="UTF-8"">
<script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="js/jquery.validate.min.js"></script>
<script type="text/javascript" src="js/messages_zh.min.js"></script>
<script charset="utf-8" src="js/bootstrap.min.js"></script>
<link href="css/style.css" rel="stylesheet">
</head>
<link type="style/sheet" ref=pe="text/javascript">
</script>
<body>
	<%
		int ID = 0;
		if (request.getParameter("id") != null) {
			ID = Integer.parseInt(request.getParameter("id"));
		}

		int num = 1;
		int pageCount=9;
		int itemCount =20;
		int offset=(pageCount-1)/2;
		int length= pageCount-1;
		
		if(pageCount>itemCount)  {
			length=itemCount-1;
		
			
		}
		
		
		
	
		if (ID > 0) {
			if (ID > offset && ID + offset <= itemCount) {
				num = ID - offset;
			}

			else if (ID + offset >= itemCount) {

				num = itemCount - length;
			}

		}

		for (int i = num; i <= num + length; i++) {
	%>


	<a type="button" href="index.jsp?id=<%=i%>"><span class="mylink"><%=i%></span></a>



	<%
		}
	%>

	<h1><%=ID%></h1>

</body>
</html>